//1:appid 2:project 3:privatekey
const ciPath = '/Users/root/Library/miniprogram-ci/node_modules/miniprogram-ci'
const ci = require(ciPath)
;(async () => {
  const project = new ci.Project({
    appid: args[0],
    type: 'miniGame',
    projectPath: args[1],
    privateKeyPath: args[2],
    ignores: ['node_modules/**/*'],
  })
  const uploadResult = await ci.upload({
    project,
    version: '1.1.1',
    desc: 'ci-upload',
    setting: {
      es6: true,
    },
    onProgressUpdate: console.log,
  })
  console.log(uploadResult)
  process.exit()
})()